//
// Created by vcq on 21/3/31.
//
#pragma once

#include "dbng.hpp"
#include "utils_dao.hpp"
#include <string>

using namespace nlohmann;
using namespace std;
using Dao = dao_t<dbng<mysql>>;

void MDeleteAll(const string& table, basic_string_view<char> id) {
    Dao dao;
    string sql = "delete FROM `";
    sql += table;
    sql+= "` where 1=1 ";
    if (!id.empty()) {
        sql += "and id=";
        sql += id.data();
        dao.execute(sql);
    }
}
